from PyQt5.QtCore import QObject, pyqtSignal

class FileSender(QObject):
    progress = pyqtSignal(int)
    finished = pyqtSignal()
    
    def __init__(self, data, serial_thread):
        super().__init__()
        self.data = data
        self.serial_thread = serial_thread
    
    def run(self):
        total = len(self.data)
        self.serial_thread.send_data(self.data, with_progress=True)
        self.progress.emit(100)
        self.finished.emit()